use anyhow::Result;

pub struct ExecuteResult{
    pub rows_affected: u64,
    pub last_insert_id: Option<u64>,
}

#[allow(dead_code)]
pub(crate) trait MyRow{}


pub trait DataBase{
    type Row: MyRow;
    async fn connect(
        &mut self, 
        host: Option<String>, 
        port: Option<u16>, 
        user: Option<String>, 
        password: Option<String>, 
        database: String,
        timezone: Option<u64>
    ) -> Result<()>;
    async fn execute(&self, sql: String) -> Result<ExecuteResult>;
    async fn query(&self, sql: String) -> Result<Vec<Self::Row>>;
}